package com.example.oasystem.dao.login;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.example.oasystem.entity.page.Page;
import com.example.oasystem.entity.user.AoaUser;
import com.example.oasystem.entity.user.AoaUserLoginRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface AoaUserDao extends BaseMapper<AoaUser> {
    //根据姓名/电话 和 密码 查询
    AoaUser getAoaUser(String userName, String password);
    //查全部user
    List<AoaUser> getAoaUserList();

    //部分查:用户，部门，等级 要在自己的部门以下
    List<AoaUser> getAoaUserListByDeptId(String deptId,String usersearch);

    List<AoaUser> getUser(long roleId);

    List<AoaUser> getAoaUserListByDeptIdLimit(String deptId,String usersearch, int number, int size);

    List<AoaUser> subordinateUsers(@Param("aoaUser") AoaUser aoaUser);
    int updateAoaUserNoPwd(AoaUser aoaUser);

    int updateAoaUserHasPwd(AoaUser aoaUser);

    int updateImgPathById(AoaUser aoaUser);
    //根据id查用户

    AoaUser selectById2(Long userId);
    AoaUser  selectByUserId(Long id);

    void delById(Long userid);
    List<AoaUser> selectByDeptId(@Param("deptId") Long deptId, @Param("page") Page page);

    int updateDeptAndPosition(@Param("changedeptid")Long changedeptid, @Param("positionid") Long positionid, @Param("userid") Long userid);

    int updatePositionId(@Param("userId") long userId,@Param("deptId") long deptId);
    List<AoaUser> selectUserDeptAndAttendsList(@Param("userId")Long userId,
                                               @Param("starttime") String starttime,
                                               @Param("endtime")String endtime,
                                               @Param("baseKey")String baseKey,
                                               @Param("number")int number,
                                               @Param("size") int size);

    List<AoaUser> selectUserDeptAndAttendsListByMonth(@Param("userId")Long userId,@Param("month")String month,
                                                      @Param("baseKey")String baseKey,
                                                      @Param("number")int number,
                                                      @Param("size") int size);

    int countDays(@Param("userId") Long userId, @Param("month")String month,@Param("type")int type);

    List<AoaUser> selectAllDeptAndPosition(String baseKey);
    List<AoaUser> selectAllDeptAndPosition2(String baseKey,Long fatherId);
    List<AoaUser> selectProcessShenuser(@Param("userName") String ... userName);
    List<AoaUser> selectAllDept();

    List<AoaUser> selectUserProcessHoliAndEvec(@Param("userId") Long userId,@Param("month")String month);

    List<AoaUser> selectAllXiashu(Long userId);

}